﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using PowersourceUIToolkit;
using UCL.Powersource;
using UCL.Powersource.Mock;

namespace PowersourceUIToolkit
{
    public class DummyUIManager : UIManagerBase
    {

        public DummyUIManager()
        {
            Initialize();
        }
        public override void Bind(IViewModel vm, System.Windows.FrameworkElement iview, object context)
        {
            return;
        }

        internal IViewConductor GetViewConductor(object rootControl)
        {
            if (rootControl is FrameworkElement)
            {
                return ViewConductors.FirstOrDefault(a => a.TopContentControl!=null && a.TopContentControl.Parent == rootControl);
            }
            else 
                return null;
            
        }

        public override IViewConductor GetViewConductor<T>(T rootControl)
        {
            return GetViewConductor(rootControl);
        }

       
        protected override bool OnInitializing()
        {
            return true;
        }

        public override Type GetViewType<T>(T rootModel)
        {
            return typeof(DummyControlForView<T>);
        }
    }
}
